import React from 'react'
import styles from './index.module.scss'
import { Flex } from 'antd-mobile'
import { withRouter } from 'react-router-dom'
import classNames from 'classnames'
function SearchBar({ cityName, history, className }) {
    return (
        <Flex className={classNames(styles.root, className)}>
            <Flex className={styles.searchLeft}>
                {/* <Link to='/citylist'> */}
                <div
                    onClick={() => history.push('/citylist')}
                    className={styles.location}>
                    <span>{cityName}</span>
                    <i className="iconfont icon-arrow"></i>
                </div>
                {/* </Link> */}
                <div className={styles.searchForm}>
                    <i className="iconfont icon-search"></i>
                    <span>请输入小区或地址</span>
                </div>
            </Flex>
            <i onClick={() => history.push('/map')} className="iconfont icon-map"></i>
        </Flex>
    )
}
export default withRouter(SearchBar)
